from sqlalchemy import Column, Integer, String, Text
from .database import Base


class Product(Base):
    __tablename__ = "products"

    id = Column(Integer, primary_key=True, index=True, autoincrement=True)
    name = Column(String(100), nullable=False)
    description = Column(Text, nullable=True)
    price = Column(Integer, nullable=False)
    category = Column(String(50), nullable=False)

    def __repr__(self):
        return f"<Product(name='{self.name}', price={self.price})>"